home *** CD-ROM | disk | FTP | other *** search
/ Building Homes of Our Own / Building Homes of our Own.iso / setup / data1.cab / Everything / working / houCons.dxr / interface_596_InteriorsDisplayActions.ls < prev    next >
Encoding:
Text File  |  2002-09-25  |  6.9 KB  |  184 lines

  1. property mySprite, myCurDisplayNum, myListToDisplay, numToDisplay, myCurDisplay, myCurItemCategory, myCurItemChoice, textDisplayField, progressDisplayField, ancestor, insetSprite, curCost
  2.  
  3. on new me, spriteNum, listToDisplay
  4.   mySprite = spriteNum
  5.   textDisplayField = "toolbarTextDisplayField"
  6.   progressDisplayField = "toolBarProgressDisplayField"
  7.   myListToDisplay = listToDisplay
  8.   myCurDisplayNum = 0
  9.   numToDisplay = count(myListToDisplay)
  10.   doNextDisplay(me)
  11.   return me
  12. end
  13.  
  14. on sendSpriteNum me, whichType
  15.   if whichType = me.myType then
  16.     return mySprite
  17.   end if
  18. end
  19.  
  20. on upDateOnScreenDisplays me
  21.   put "sprite" && mySprite & "got <upDateOnScreenDisplays>"
  22.   if voidp(insetSprite) then
  23.     insetSprite = sendAllSprites(#sendSpriteNum, #IntInset)
  24.   end if
  25.   sendSprite(insetSprite, #show, myCurItemChoice)
  26.   updateOnScreenText(me)
  27. end
  28.  
  29. on doNextDisplay me
  30.   if voidp(insetSprite) then
  31.     insetSprite = sendAllSprites(#sendSpriteNum, #IntInset)
  32.   end if
  33.   if myCurDisplayNum = numToDisplay then
  34.     exit
  35.   end if
  36.   myCurDisplayNum = myCurDisplayNum + 1
  37.   myCurDisplay = myListToDisplay[myCurDisplayNum]
  38.   myCurItemCategory = symbol(word 2 of myCurDisplay)
  39.   myCurItemChoice = symbol(word 2 of myCurDisplay & "_" & word 3 of myCurDisplay)
  40.   set the member of sprite mySprite to member(myCurDisplay)
  41.   sendSprite(insetSprite, #show, myCurItemChoice)
  42.   updateOnScreenText(me)
  43.   if myCurDisplayNum = numToDisplay then
  44.     return #LastDisplay
  45.   else
  46.     return 1
  47.   end if
  48. end
  49.  
  50. on doPreviousDisplay me
  51.   if myCurDisplayNum = 1 then
  52.     exit
  53.   end if
  54.   if voidp(insetSprite) then
  55.     insetSprite = sendAllSprites(#sendSpriteNum, #IntInset)
  56.   end if
  57.   myCurDisplayNum = myCurDisplayNum - 1
  58.   myCurDisplay = myListToDisplay[myCurDisplayNum]
  59.   myCurItemCategory = symbol(word 2 of myCurDisplay)
  60.   myCurItemChoice = symbol(word 2 of myCurDisplay & "_" & word 3 of myCurDisplay)
  61.   set the member of sprite mySprite to member(myCurDisplay)
  62.   sendSprite(insetSprite, #show, myCurItemChoice)
  63.   updateOnScreenText(me)
  64.   if myCurDisplayNum = 1 then
  65.     return #FirstDisplay
  66.   else
  67.     return 1
  68.   end if
  69. end
  70.  
  71. on getCurDisplayStatus me
  72.   if myCurDisplayNum = 1 then
  73.     return #First
  74.   else
  75.     if myCurDisplayNum = numToDisplay then
  76.       return #last
  77.     else
  78.       return #mid
  79.     end if
  80.   end if
  81. end
  82.  
  83. on getCurChoice me
  84.   myChoice = symbol(word 3 of myCurDisplay)
  85.   return myChoice
  86. end
  87.  
  88. on getCurCost me
  89.   return curCost
  90. end
  91.  
  92. on updateOnScreenText me
  93.   global gToolBarTextMan, gCostMan
  94.   progressText = myCurDisplayNum && "of" && numToDisplay
  95.   put progressText into field progressDisplayField
  96.   displayText = getInfoDisplayText(me)
  97.   useAsString = 1
  98.   setToolBarText(gToolBarTextMan, displayText, useAsString)
  99. end
  100.  
  101. on getInfoDisplayText me, curDisplay
  102.   global gCostMan, gConMan
  103.   case myCurItemCategory of
  104.     #flooring:
  105.       curRoom = sendAllSprites(#sendFlooringRoomType)
  106.       curCost = getFlooringCosts(gCostMan, curRoom, myCurItemChoice)
  107.       case curRoom of
  108.         #bath:
  109.           displayString = "To choose this material for all bathroom floors, " && RETURN
  110.           put "hit the PURCHASE button.  Cost: " & formatMonetaryForDisplay(curCost) after displayString
  111.         #kitchen:
  112.           displayString = "To choose this material for your kitchen floor, " && RETURN
  113.           put "hit the PURCHASE button.  Cost: " & formatMonetaryForDisplay(curCost) after displayString
  114.         #other:
  115.           displayString = "To choose this material for all other floors, " && RETURN
  116.           put "hit the PURCHASE button.  Cost: " & formatMonetaryForDisplay(curCost) after displayString
  117.       end case
  118.     #bath:
  119.       curCost = getInteriorItemCost(gCostMan, myCurItemChoice)
  120.       numBathrooms = getNumBathrooms(gConMan)
  121.       case numBathrooms of
  122.         2:
  123.           numBathString = "two"
  124.         3:
  125.           numBathString = "three"
  126.         4:
  127.           numBathString = "four"
  128.         5:
  129.           numBathString = "five"
  130.       end case
  131.       numBathRoomsDecided = getNumBathroomsDecided(gConMan)
  132.       thisBathRoom = getNextInteriorDecision(gConMan)
  133.       displayString = EMPTY
  134.       if thisBathRoom = #masterbathroom then
  135.         if numBathrooms = 1 then
  136.           put "You have planned one bathroom. To choose this style for your master bathroom hit the PURCHASE button. Cost: " & formatMonetaryForDisplay(curCost) after displayString
  137.         else
  138.           put "You have planned " && numBathString && "bathrooms. You need to select a style for each bathroom. To choose this style for your master bathroom hit the PURCHASE button. Cost: " & formatMonetaryForDisplay(curCost) after displayString
  139.         end if
  140.       else
  141.         if numBathrooms = 1 then
  142.           put "You have planned one bathroom.To choose this style for your bathroom hit the PURCHASE button. Cost: " & formatMonetaryForDisplay(curCost) after displayString
  143.         else
  144.           if numBathRoomsDecided = 0 then
  145.             put "You have planned " && numBathString && "bathrooms. You need to select a style for each bathroom. To choose this style for your first bathroom hit the PURCHASE button. Cost: " & formatMonetaryForDisplay(curCost) after displayString
  146.           else
  147.             case numBathRoomsDecided of
  148.               1:
  149.                 whichBath = "second"
  150.               2:
  151.                 whichBath = "third"
  152.               3:
  153.                 whichBath = "fourth"
  154.               4:
  155.                 whichBath = "fifth"
  156.             end case
  157.             put "Please select a style for the" && whichBath && "bathroom. To choose this type for your" && whichBath && "bathroom, hit the PURCHASE button. Cost: " & formatMonetaryForDisplay(curCost) after displayString
  158.           end if
  159.         end if
  160.       end if
  161.     #kitchenStyles:
  162.       curCost = getInteriorItemCost(gCostMan, myCurItemChoice)
  163.       displayString = "To choose this type of kitchen for your house hit the PURCHASE button. Cost: "
  164.       put formatMonetaryForDisplay(curCost) after displayString
  165.     #staircases:
  166.       curCost = getInteriorItemCost(gCostMan, myCurItemChoice)
  167.       displayString = "To choose this type for all staircases, hit the PURCHASE button. Cost: "
  168.       put formatMonetaryForDisplay(curCost) after displayString
  169.     #fireplaces:
  170.       curCost = getInteriorItemCost(gCostMan, myCurItemChoice)
  171.       displayString = "To choose this type for all fireplaces, hit the PURCHASE button. Cost: "
  172.       put formatMonetaryForDisplay(curCost) after displayString
  173.     #intAm, #interiorAmenities:
  174.       curCost = getInteriorItemCost(gCostMan, myCurItemChoice)
  175.       displayString = "You may select additional amenities for your home.  When you have selected and purchased the amenities you desire, if any, hit COMPLETE. To choose this amenity, hit the PURCHASE button.  Cost: "
  176.       put formatMonetaryForDisplay(curCost) after displayString
  177.     otherwise:
  178.       curCost = getInteriorItemCost(gCostMan, myCurItemChoice)
  179.       displayString = "To choose this item, " && RETURN
  180.       put "hit the PURCHASE button.  Cost: $" & curCost after displayString
  181.   end case
  182.   return displayString
  183. end
  184.